# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: VVL <me@ivvl.ru>
# Contributor: Alexander Görtz <aur@nyloc.de>
# Contributor: Patrick Burroughs (Celti) <celti@celti.name>

pkgname=dehydrated
pkgver=0.7.1
pkgrel=1
pkgdesc='letsencrypt/acme client implemented as a shell-script – just add water'
arch=('any')
url=https://dehydrated.io
license=('MIT')
depends=('curl' 'diffutils' 'openssl')
optdepends=('sudo: for the DEHYDRATED_USER option')
source=("https://github.com/$pkgname-io/$pkgname/archive/v$pkgver/$pkgname-v$pkgver.tar.gz"
        "$pkgname".{service,timer})
b2sums=('946f6ec7caadcb9bb52a31614759334a36d89f770b0a95094327ac67d4872582a32d0e82f1baa1e09e81badb4b525c090bd8f9ad40da89051eedec205a476bf8'
        'd897cdf34621b377e6f9e6ba6d6a351f3290f6b08fd57fce723a85e44fe73b75003941bfa625e2213f4bb26e0753ab7d3e1f50a2530d0b6c37766b3061bec2ce'
        'df0d85ae33cbd27502bbbcf3f3055a29b2d38b2863a59dc6ea4fce1c7811b68bea14c404377dfde18ed32b1232331db020ca8d015f471fb6f8e919e7b0a32d2a')

package() {
  cd $pkgname-$pkgver
  install -d "$pkgdir"/etc/$pkgname
  install -Dt "$pkgdir"/usr/bin $pkgname
  install -Dm644 -t "$pkgdir"/usr/lib/systemd/system ../$pkgname.{service,timer}
  install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname docs/*.md
  install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname/examples docs/examples/*
  install -Dm644 -t "$pkgdir"/usr/share/man/man1 docs/man/$pkgname.1
  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
}
